import request from '@/utils/request'

// 查询知识点管理列表
export function listManager(query) {
  return request({
    url: '/receipt/knowledgeManager/list',
    method: 'get',
    params: query
  })
}

//查询知识点目录数据
export function getTreeData(query) {
  return request({
    url: 'http://localhost:8080/knowledgeList/getTreeList',
    method: 'get',
    params: query
  })
}

// 查询知识点管理详细
export function getManager(id) {
  return request({
    url: '/receipt/knowledgeManager/' + id,
    method: 'get'
  })
}

// 新增知识点管理
export function addManager(data) {
  return request({
    url: '/receipt/knowledgeManager',
    method: 'post',
    data: data
  })
}

// 修改知识点管理
export function updateManager(data) {
  return request({
    url: '/receipt/knowledgeManager',
    method: 'put',
    data: data
  })
}

// 删除知识点管理(真删除)
export function delManager(id) {
  return request({
    url: '/receipt/knowledgeManager/' + id,
    method: 'delete'
  })
}

// 删除知识点管理(逻辑删除)
export function delManagerReal(id) {
  return request({
    url: '/receipt/knowledgeManager/delManagerLogic/' + id,
    method: 'delete'
  })
}

// 导出知识点管理
export function exportManager(query) {
  return request({
    url: '/receipt/knowledgeManager/export',
    method: 'get',
    params: query
  })
}

// 导出知识点审核列表
export function exportManagerAudit(query) {
  return request({
    url: '/receipt/knowledgeManager/exportAudit',
    method: 'get',
    params: query
  })
}

//模糊查询
export function selectKmName(name){
  return request({
    url: '/receipt/knowledgeManager/listName/' + name,
    method: 'get',
  })
}
//模糊审核的知识点
export function selectKnowledge(query){
  return request({
    url: '/receipt/knowledgeManager/selectKnowledge' ,
    method: 'get',
     params: query
  })
}
